export async function canUseCamera() {
  if(!navigator.mediaDevices){
    return 
  }
  if(!navigator.mediaDevices.enumerateDevices){
    return
  }
 let devices:MediaDeviceInfo[]
 try {
  devices =  await navigator.mediaDevices.enumerateDevices()
 } catch (error) {
  return
 }
 const hasVideo = devices.some(device => {
  return device.kind == 'videoinput'
 })
 if(!hasVideo){
  return
 }
 return true
}